home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2008 September
/
PCWorld_2008-09_cd.bin
/
v cisle
/
sadanastroju
/
cacheviewer-0.4.7.1-fx.xpi
/
chrome
/
cacheviewer.jar
/
content
/
cacheviewer
/
overlay.js
< prev
next >
Wrap
Text File
|
2006-05-24
|
1KB
|
44 lines
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents (ry
*
* ***** END LICENSE BLOCK *****
*/
function showCacheViewer() {
var sepwin = gPrefService.getBoolPref("extensions.cacheviewer.open_in_separate_window");
var needToOpen = true;
var windowType = "CacheViewer";
if (sepwin) {
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
.getService(Components.interfaces.nsIWindowMediator);
var windows = wm.getEnumerator(windowType);
while (windows.hasMoreElements()) {
var theEM = windows.getNext().QueryInterface(Components.interfaces.nsIDOMWindowInternal);
if (theEM.document.documentElement.getAttribute("windowtype") == windowType) {
theEM.focus();
needToOpen = false;
break;
}
}
if (needToOpen) {
const EMURL = "chrome://cacheviewer/content/cacheviewer.xul";
const EMFEATURES = "chrome, all, dialog=no, centerscreen";
window.openDialog(EMURL, "", EMFEATURES);
}
} else {
var tab = getBrowser().mTabContainer.firstChild;
while (tab) {
if (getBrowser().getBrowserForTab(tab).contentDocument.documentElement.getAttribute("windowtype") == windowType) {
getBrowser().selectedTab = tab;
needToOpen = false;
break;
}
tab = tab.nextSibling;
}
if (needToOpen) {
getBrowser().selectedTab = getBrowser().addTab("chrome://cacheviewer/content/cacheviewer.xul");
}
}
}